package com.itheima.controller;

import com.itheima.Service.OrderService;
import com.itheima.common.entity.PageResult;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.common.entity.Result;
import com.itheima.pojo.OrderTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Slf4j
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;
    /**
     * 分页查询预约列表
     */
    @PostMapping("/findPage")
    public PageResult findpage(@RequestBody QueryPageBean queryPageBean ) {
        log.info("预约列表查询:{}",queryPageBean);
        PageResult P=orderService.listpage(queryPageBean);
        return P;
    }
    /**
     * 修改预约状态
     */
    @PostMapping("/update")
    public Result UPDATEstuatus(@RequestBody OrderTO orderTO){
        log.info("修改状态;{}",orderTO);
        orderService.updatestatus(orderTO);
        return new Result(true, "修改预约状态成功",null);

    }
    /**
     * 根据id查询预约表
     */


}
